package com.agileboot.domain.store;

import cn.hutool.core.util.StrUtil;
import com.agileboot.common.core.page.AbstractPageQuery;
import com.agileboot.domain.store.db.StoreInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author lx
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class StoreQuery extends AbstractPageQuery<StoreInfo> {

    //草药名称
    private String medicineName;

    @Override
    public QueryWrapper<StoreInfo> addQueryCondition() {
        QueryWrapper<StoreInfo> queryWrapper = new QueryWrapper<StoreInfo>()
                .like(StrUtil.isNotEmpty(medicineName), "medicine_name", medicineName)
                .eq("deleted", 0);
        return queryWrapper;
    }
}
